# Manipulación de estructuras
library(tidyverse)
## -- Attaching packages --------------------------------------- tidyverse 1.3.0 --
## v ggplot2 3.3.3 v purrr 0.3.4
## v tibble 3.1.0 v dplyr 1.0.5
## v tidyr 1.1.3 v stringr 1.4.0
## v readr 1.4.0 v forcats 0.5.1
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library(dplyr)
library(tidyr)
# Para realizar plots
#library(scatterplot3d)
library(ggplot2)
# library(plotly)
# Manipulación de varios plots en una imagen.
# library(gridExtra)
# library(grid)
random.abb = read.table("Resultados/aleatorioAbb.txt")
random.avl = read.table("Resultados/aleatorioAvl.txt")
random.splay = read.table("Resultados/aleatorioSplay.txt")
random.btree16 = read.table("Resultados/aleatorioBtree16.txt")
random.btree256 = read.table("Resultados/aleatorioBtree256.txt")
random.btree4096 = read.table("Resultados/aleatorioBtree4096.txt")
Experimento_aleatorio <- data.frame(Operacion = integer(),
V1 = double(),
Estructura = factor())
z <- data.frame(Operacion = c(1:1000), V1 = random.abb, Estructura = "ABB")
Experimento_aleatorio <- rbind(Experimento_aleatorio, z)
z <- data.frame(Operacion = c(1:1000), V1 = random.avl, Estructura = "AVL")
Experimento_aleatorio <- rbind(Experimento_aleatorio, z)
z <- data.frame(Operacion = c(1:1000), V1 = random.splay, Estructura = "Splay")
Experimento_aleatorio <- rbind(Experimento_aleatorio, z)
z <- data.frame(Operacion = c(1:1000), V1 = random.btree16, Estructura = "BTree16")
Experimento_aleatorio <- rbind(Experimento_aleatorio, z)
z <- data.frame(Operacion = c(1:1000), V1 = random.btree256, Estructura = "BTree256")
Experimento_aleatorio <- rbind(Experimento_aleatorio, z)
z <- data.frame(Operacion = c(1:1000), V1 = random.btree4096, Estructura = "BTree4096")
Experimento_aleatorio <- rbind(Experimento_aleatorio, z)
plot <- ggplot(data = Experimento_aleatorio, aes(x=Operacion, y=V1), inherit.aes = FALSE) +
geom_line(aes(colour=Estructura)) +
xlab("Iteraciones") +
ylab("Tiempo") +
ggtitle("Tiempo por cada segmento de operaciones\nExperimento aleatorio") +
theme(plot.title = element_text(hjust = 0.5))
plot
A work by cd